/** ------------------------------------------------------------------------
 *	VisualGroup JavaScript prototype Classes, version draf
 *  (c) 2006 Bill Vison <vison_ruan@126.com>
 *
 *
/*--------------------------------------------------------------------------*/


/**
 * 
 * @Prototype Class : "Vsg.Event.CheckBoxEvent"
 *						that will be render event style
 * @prerequire class : 	"Vsg.Common.Logger"
 *						
 */
using("Vsg.Common.Logger");
 
Vsg.Event.CheckBoxEvent = Class.create();
Vsg.Event.CheckBoxEvent.prototype.initialize = function() {

}

Vsg.Event.CheckBoxEvent.selectAll = function($refOwnerObj , $destCheckBoxGroup) {
	try {
		if ($refOwnerObj.type != "checkbox") {
			throw "指定的源类不是'checkbox'类型!";
		}
		if ($destCheckBoxGroup.length == undefined ) {
			throw "目标类型指定出错!";
		}
		
		$refOwnerObj.onclick = function() {
			for (var $indx = 0 ; $indx < $destCheckBoxGroup.length ; $indx++) {
				if ($refOwnerObj.checked != $destCheckBoxGroup[$indx].checked) {
					$destCheckBoxGroup[$indx].click();
				}
			}

		}
		

	} catch (ex) {
		alert(ex);
	}
}
